/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Spider-Man
 * Date: 2025-03-12
 * Time: 11:57
 */
public class maxArea {


    public static int getMaxArea(int[] height) {
        int left = 0, right = height.length- 1;
        int area = 0;
        while (left < right) {
            int v = Math.min(height[right],height[left]) * (right - left);
            area = Math.max(v,area);
            if(height[left] < height[right]) left++;
            else right--;
        }
        return area;
    }


    public static void main(String[] args) {
        int[] height = {1,1};
        System.out.println(getMaxArea(height));
    }
}
